<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="../include/head.jsp" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%> 
<!DOCTYPE HTML>
<html>
<head>

<title>综合管理-访问日志</title>
<style type="text/css">

		html,
body {
  height:100%;
  margin:0;
  padding:0;
  font:small/1.5 "宋体", serif; 
  overflow-y: hidden;
}


</style>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/lib/easyui/1.5.3/themes/metro/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/lib/easyui/1.5.3/themes/icon.css?v=20171205">

<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jquery/1.9.1/jquery.min.js"></script>  
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/easyui/1.5.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/easyui/1.5.3/locale/easyui-lang-zh_CN.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/common/public.js?v=20180416"></script> 


<style type="text/css">
.combobox-item,#layersRadioBtn,#layersSencesBtn,#layersBtn,#layersBandBtn,#submit,#BtnExport,#BtnImport:hover {
	cursor: pointer;
}

.listSearch:hover {
	cursor: pointer;
	background-color: #E0ECFF;
}

 

.tabs {
	padding: 0px;
}

.tabs-header {
	height: auto;
}

.tabs-wrap {
	height: auto;
}

.tabs-panels-top {
	border-width: 0;
}

/**工具栏**/
#tool {
	position: fixed;
	top: 0px;
	left: 60px;
	height: 22px;
	line-height: 22px;
	right: 2px;
	padding: 3px;
	overflow: hidden;
	z-index: 5;
}

.combo .combo-text {
	padding: 0px;
}

#max,#restore:HOVER {
	cursor: pointer;
}
 
 

.datebox {
	width: 135px;
}

#fdsfs:hover {
	cursor: pointer;
}

.tableBody {
	border-bottom: 1px solid #888;
}
</style>
  
</head>
<body>
 
	<div id="panel" class="easyui-panel"
		data-options="fit:true,border:false" title="日志明细">
		
		<shiro:hasPermission name="/logger/findLogs or /logger/exportCallInfo ">
		<div id="tool">
			<div style="position: relative; float: left; z-index: 1000;">
				&nbsp;起始日期:<input id="startDateBox"  style="width: 90px;"></input>  
			</div>
			<div style="position: relative; float: left; z-index: 1000;">
				&nbsp;结束日期:<input id="endDateBox"  style="width: 90px;"></input>  
			</div>
		 	<!-- <div style="position: relative; float: left; z-index: 1000;">
				&nbsp;用户名:<input id="user" type="text" style="width: 120px;"></input>  
			</div> -->
			 <shiro:hasPermission name="/logger/findLogs">
			 	 <div id="submit" style="position: relative; top: 0px; padding-left: 5px; border: 1px solid #95B8E7; height: 20px; width: 30px; float: left; z-index: 1001;" onclick="submit()">确定</div>	
			  </shiro:hasPermission> 	
			 <shiro:hasPermission name="/logger/exportCallInfo">
			 	 <div id="submit"
				style="position: relative; top: 0px; padding-left: 5px; border: 1px solid #95B8E7; height: 20px; width: 30px; float: left; z-index: 1001;" onclick="exportInfos()">导出</div>	
		    </shiro:hasPermission> 
		   	  </div>
	
	 <shiro:hasPermission name="/logger/exportCallInfo">
		<script type="text/javascript">
	 
	//导出统计
	function exportInfos() {
		
		//取出所有的信息 
 		var start =    $("#startDateBox").datebox("getValue");
 		var end =    $("#endDateBox").datebox("getValue");
 		/* var user =    $("#user").val(); */
 		 
		//时间和场景不为空即可
		if(start == null || start == 'undefind' || start.length < 1 ) {
			
			alert("起始日期不能为空");
			return ;
		}
		//时间和场景不为空即可
		if(end == null || end == 'undefind' || end.length < 1 ) {
			
			alert("结束日期不能为空");
			return ;
		}
		
		 
		start = start.replace(/\-/g,"");
		end = end.replace(/\-/g,"");
		
		window.location='./exportCallInfo?start=' + start + '&end=' + end  ;
		
	}
	
</script>
		  </shiro:hasPermission>   
			  <shiro:hasPermission name="/logger/findLogs">
			 	 <table id="dg" class="easyui-datagrid"   style="width:100%;height:600px;"
           			 data-options="singleSelect:true,collapsible:true,method:'post',pagination:true, 
	    			rownumbers:true,
	   				 pageSize:20,url:'./findLogs'">
        		<thead>
            		<tr>
                		<th data-options="field:'user_name',width:80">用户</th>
                		<th data-options="field:'crtime',width:200,align:'left',formatter:function(_value,row){
             				var d = new Date(_value);
             			
             				var s = dateFtt('yyyy-MM-dd hh:mm:ss.S' , d) ;
             			 
                 			return s ;
                  		}">访问时间</th>
                	<th data-options="field:'model',width:80,align:'right'">访问模块</th>
                 	<th data-options="field:'name',width:80">访问功能</th> 
                 	<th data-options="field:'result',width:80">访问结果</th> 
                 	<th data-options="field:'exception',width:200">异常信息</th> 
                	<th data-options="field:'content',width:200">操作内容</th> 
            	</tr>
        		</thead>
    		</table>
    		
    		<script type="text/javascript">
    		function submit() {
    			
    			 
    			//取出所有的信息 
    	 		var start =    $("#startDateBox").datebox("getValue");
    	 		var end =    $("#endDateBox").datebox("getValue");
    	 		
    			//时间和场景不为空即可
    			if(start == null || start == 'undefind' || start.length < 1 ) {
    				
    				alert("起始日期不能为空");
    				return ;
    			}
    			//时间和场景不为空即可
    			if(end == null || end == 'undefind' || end.length < 1 ) {
    				
    				alert("结束日期不能为空");
    				return ;
    			}
    			
    			 
    			start = start.replace(/\-/g,"");
    			end = end.replace(/\-/g,"");
    		  
    			/* var user =    $("#user").val(); */
    			 
    			 $("#dg").datagrid('load' , {'start':start , 'end' : end  });
    			  
    	         
    		}
    		
    		</script>
			
			
			</shiro:hasPermission>
		   
		
		
		<script type="text/javascript">
		$("#startDateBox").datebox({
			required:true 
		});
		$("#endDateBox").datebox({
			required:true 
		});
		 
		 
	 
		var curr = new Date() ;
		var time1 = dateFtt("yyyy-MM-dd HH:mm:ss" , curr);
		curr.setMonth(curr.getMonth() - 1);
		var time2 = dateFtt("yyyy-MM-dd HH:mm:ss", curr);  
		
		 $("#startDateBox").datebox('setValue',time2);

		 $("#endDateBox").datebox('setValue',time1);
		
		</script>
		
		</shiro:hasPermission>
		
		
		
    
     
    
</div>
		  
	
 

	 
</body>
</html>